package c.x.jy.wexin.config.model;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import lombok.Data;
@Data
@Configuration
public class JedisConf {
	  @Value("${spring.redis.host:127.0.0.1}")
      private String host;
      @Value("${spring.redis.port:6379}")
      private Integer port;
      @Value("${spring.redis.password:}")
      private String password;
      @Value("${spring.redis.database:0}")
      private Integer database;

      @Value("${spring.redis.jedis.pool.max-active:8}")
      private Integer maxActive;
      @Value("${spring.redis.jedis.pool.max-idle:8}")
      private Integer maxIdle;
      @Value("${spring.redis.jedis.pool.max-wait:-1}")
      private Long maxWait;
      @Value("${spring.redis.jedis.pool.min-idle:0}")
      private Integer minIdle;
 
      public String getHost() {
    	  String os = System.getProperty("os.name"); 
    	  System.out.println(os);
    	  if(os.toLowerCase().startsWith("win")){ 
    			return "127.0.0.1";
    	  }
		return host;
    	  
      }
      
}
